function animate(obj,target) {
    clearInterval(obj.timer);
    var step = (target-obj.offsetLeft)/ 10;
    step = step >0 ?  Math.celi(step): Math.floor(step);
    obj.timer = setInterval(function() {
        if (obj.offsetLeft <= target) {
            clearInterval(obj.timer); 
        }
        obj.style.left = obj.offsetLeft+ step + 'px';
    }, 15);
}